@{ViewBag.Title = "ReclamoProducto::.";}
@section CssImport{<link href="@Url.Content("~/Scripts/validationEngine/validationEngine.jquery.css")" rel="stylesheet" type="text/css" />}
@section JavascriptImport{
<script type="text/javascript" src="@Url.Content("~/Scripts/validationEngine/jquery.validationEngine.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/validationEngine/jquery.validationEngine-en.js")"></script>}
<fieldset>
<legend>GESTIONAR</legend>
         <ul id="menu">
            @*<li><a href="../Reclamo/FilterList">GESTIONAR RECLAMOS</a></li>*@
            <li><a href="../Responsable/FilterList">GESTIONAR RESPONSABLE</a></li>
        </ul>
        </fieldset>
<div class="filtering"><form>
<label>NOMBRE: <input type="text" name="filter" id="filter" /></label>
<button type="submit" id="LoadRecordsButton">Buscar</button>
</form></div>
<div id="MyTableContainer"></div>
<script type="text/javascript">
     $(document).ready(function () {
     $('#MyTableContainer').jtable({
         title: 'ReclamoProducto',
         paging: true,
         pageSize: 10,
         sorting: true,
         defaultSorting: 'Id ASC',
         actions: {
             listAction: '@Url.Action("JSONPagedListByFilter")',
             deleteAction: '@Url.Action("JSONDelete")',
             updateAction: '@Url.Action("JSONUpdate")',
             createAction: '@Url.Action("JSONCreate")'
         },
         fields:
         {
          Id: {
                 key: true,
                 create: false,
                 edit: false,
                 list: false
             }
             ,
             CantidadReportada: {
                 title:'CantidadReportada',
                 create: true,
                 edit: false,
                 list: true,
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             Codificacion: {
                 title:'Codificacion',
                 create: true,
                 edit: false,
                 list: false,
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             FechaConsumo: {
                 title:'Fecha de Consumo',
                 create: true,
                 edit: true,
                 list: true,
                 type: 'date',
                 displayFormat: 'dd-mm-yy',
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             FechaAdquisicion: {
                 title:'FechaAdquisicion',
                 create: true,
                 edit: true,
                 list: false,
                 type: 'date',
                 displayFormat: 'dd-mm-yy',
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             FechaVisita: {
                 title:'FechaVisita',
                 create: true,
                 edit: true,
                 list: true,
                 type: 'date',
                 displayFormat: 'dd-mm-yy',
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             Descripcion: {
                 title:'Descripcion',
                 create: true,
                 edit: true,
                 list: false,
                 sorting: false
             }
             ,
             CantidadRetirada: {
                 title:'CantidadRetirada',
                 create: true,
                 edit: false,
                 list: false,
                 sorting: false
             }
             ,
             ResultadoVisita: {
                 title:'ResultadoVisita',
                 create: true,
                 edit: true,
                 list: true,
                 sorting: false
             }
             ,
             ResultadoLaboratorio: {
                 title:'ResultadoLaboratorio',
                 create: true,
                 edit: true,
                 list: true,
                 sorting: false
             }
             ,
             FechaAnalisis: {
                 title:'FechaAnalisis',
                 create: true,
                 edit: true,
                 list: true,
                 type: 'date',
                 displayFormat: 'dd-mm-yy',
                 sorting: false
             }
             ,
             ComentarioCierre: {
                 title:'ComentarioCierre',
                 create: true,
                 edit: true,
                 list: false,
                 sorting: false
             }
             ,
             Nombre: {
                 title:'Nombre',
                 create: true,
                 edit: true,
                 list: true,
                 sorting: false
             }
             ,
             Solicitud_FK:{
                 title : 'Actitud',
                 create : true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../Actitud/JSONGetElementsForDropDownList")'
             }
             ,
             CanalId_FK:{
                 title : 'Canal',
                 create: true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../Canal/JSONGetElementsForDropDownList")'
             }
             ,
             CiudadId_FK:{
                 title : 'Ciudad',
                 create: true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../Ciudad/JSONGetElementsForDropDownList")'
             }
             ,
             LugarAdquisicionId_FK:{
                 title : 'LugarAdquisicion',
                 create: true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../LugarAdquisicion/JSONGetElementsForDropDownList")'
             }
             ,
             ProductoId_FK:{
                 title : 'Producto',
                 create: true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../Producto/JSONGetElementsForDropDownList")'
             }
             ,
             ResponsableId_FK:{
                 title : 'Responsable',
                 create : true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../Responsable/JSONGetElementsForDropDownList")'
             }
},
formCreated: function (event, data) {data.form.validationEngine();},
formSubmitting: function (event, data) {return data.form.validationEngine('validate');},
formClosed: function (event, data) { data.form.validationEngine('hide'); data.form.validationEngine('detach'); }
});
$('#LoadRecordsButton').click(function (e) {e.preventDefault();$('#MyTableContainer').jtable('load', {filter: $('#filter').val()});});
$('#LoadRecordsButton').click();
});
</script>

